Part 2 of previous commit (aka "it compiles now, ma")
authorElliot Lee <sopwith@src.gnome.org>
Fri, 28 Jul 2000 00:16:17 +0000 (00:16 +0000)
committerElliot Lee <sopwith@src.gnome.org>
Fri, 28 Jul 2000 00:16:17 +0000 (00:16 +0000)
Part 2 of previous commit (aka "it compiles now, ma")

gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/gdk-pixbuf-loader.c
gdk-pixbuf/io-wbmp.c
gtk/gdk-pixbuf-loader.c

index ff9bc030804b65a5010c183b892df1e110347291..a063f4d41e0b4a5b93e2a9898cdd41278f1f674c 100644 (file)
@@ -195,7 +195,7 @@ static GdkPixbufModule file_formats [] = {
        { "ras",  pixbuf_check_sunras, NULL,  NULL, NULL, NULL, NULL, NULL },
        { "ico",  pixbuf_check_ico, NULL,  NULL, NULL, NULL, NULL, NULL },
        { "bmp",  pixbuf_check_bmp, NULL,  NULL, NULL, NULL, NULL, NULL },
-       { "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL }
+       { "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL },
        { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };
 
index 63302937b9dc85ea90e85ded00db071100a31e8a..c6ae8e2f21b3334ed0993d509a04191f68d4cb0d 100644 (file)
@@ -399,7 +399,7 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader,
   
   if (priv->header_buf_offset >= LOADER_HEADER_SIZE)
     {
-      if (gdk_pixbuf_loader_load_module (loader) == 0)
+      if (gdk_pixbuf_loader_load_module (loader, NULL) == 0)
        return 0;
     }
   
@@ -563,7 +563,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
   
   /* We have less the 128 bytes in the image.  Flush it, and keep going. */
   if (priv->image_module == NULL)
-    gdk_pixbuf_loader_load_module (loader);
+    gdk_pixbuf_loader_load_module (loader, NULL);
   
   if (priv->image_module && priv->image_module->stop_load)
     priv->image_module->stop_load (priv->context);
index 05949faead46820ed2afc30fcc715559fd8c7861..4b7dced9f9cc9440fa38df4438bf8eb3823aa7a8 100644 (file)
@@ -79,7 +79,7 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f)
 {
        size_t length;
        char membuf[4096];
-       struct bmp_progressive_state *State;
+       struct wbmp_progressive_state *State;
 
        GdkPixbuf *pb;
 
@@ -98,7 +98,7 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f)
 
        pb = State->pixbuf;
 
-       gdk_pixbuf__bmp_image_stop_load(State);
+       gdk_pixbuf__wbmp_image_stop_load(State);
        return pb;
 }
 
@@ -115,9 +115,9 @@ gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
                                 ModuleAnimationDoneNotifyFunc
                                 anim_done_func, gpointer user_data)
 {
-       struct bmp_progressive_state *context;
+       struct wbmp_progressive_state *context;
 
-       context = g_new0(struct bmp_progressive_state, 1);
+       context = g_new0(struct wbmp_progressive_state, 1);
        context->prepared_func = prepared_func;
        context->updated_func = updated_func;
        context->user_data = user_data;
@@ -136,8 +136,8 @@ gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
  */
 void gdk_pixbuf__wbmp_image_stop_load(gpointer data)
 {
-       struct bmp_progressive_state *context =
-           (struct bmp_progressive_state *) data;
+       struct wbmp_progressive_state *context =
+           (struct wbmp_progressive_state *) data;
 
        g_return_if_fail(context != NULL);
        if (context->pixbuf)
@@ -147,7 +147,7 @@ void gdk_pixbuf__wbmp_image_stop_load(gpointer data)
 }
 
 static gboolean
-getin(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size, guchar *ptr, int datum_size)
+getin(struct wbmp_progressive_state *context, guchar **buf, guint *buf_size, guchar *ptr, int datum_size)
 {
   int last_num, buf_num;
 
@@ -165,10 +165,12 @@ getin(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size
     memmove(context->last_buf, context->last_buf+last_num, context->last_len);
   *buf_size -= buf_num;
   *buf += buf_num;
+
+  return TRUE;
 }
 
 static gboolean
-save_rest(struct bmp_progressive_state *context, const guchar *buf, guint buf_size)
+save_rest(struct wbmp_progressive_state *context, const guchar *buf, guint buf_size)
 {
   if(buf_size > (sizeof(context->last_buf) - context->last_len))
     return FALSE;
@@ -180,11 +182,10 @@ save_rest(struct bmp_progressive_state *context, const guchar *buf, guint buf_si
 }
 
 static gboolean
-get_mbi(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size, int *val)
+get_mbi(struct wbmp_progressive_state *context, guchar **buf, guint *buf_size, int *val)
 {
   guchar intbuf[16];
   int i, n;
-  guchar last;
   gboolean rv;
 
   *val = 0;
@@ -221,8 +222,8 @@ get_mbi(struct bmp_progressive_state *context, const guchar **buf, guint *buf_si
 gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data, guchar * buf,
                                              guint size)
 {
-       struct bmp_progressive_state *context =
-           (struct bmp_progressive_state *) data;
+       struct wbmp_progressive_state *context =
+           (struct wbmp_progressive_state *) data;
        gboolean bv;
 
        do
@@ -273,7 +274,7 @@ gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data, guchar * buf,
                first_row = context->cury;
                for( ; context->cury < context->height; context->cury++, context->curx = 0)
                  {
-                   for( ; context->curx < context->width, context->curx += 8)
+                   for( ; context->curx < context->width; context->curx += 8)
                      {
                        guchar byte;
                        guchar *ptr;
index 63302937b9dc85ea90e85ded00db071100a31e8a..c6ae8e2f21b3334ed0993d509a04191f68d4cb0d 100644 (file)
@@ -399,7 +399,7 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader,
   
   if (priv->header_buf_offset >= LOADER_HEADER_SIZE)
     {
-      if (gdk_pixbuf_loader_load_module (loader) == 0)
+      if (gdk_pixbuf_loader_load_module (loader, NULL) == 0)
        return 0;
     }
   
@@ -563,7 +563,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
   
   /* We have less the 128 bytes in the image.  Flush it, and keep going. */
   if (priv->image_module == NULL)
-    gdk_pixbuf_loader_load_module (loader);
+    gdk_pixbuf_loader_load_module (loader, NULL);
   
   if (priv->image_module && priv->image_module->stop_load)
     priv->image_module->stop_load (priv->context);